<?php
require "../common.php";
$id = $_GET['id'];
$result = $mysqli->query("select * from `article` where `id` = '$id'");
$art = $result->fetch_assoc();

if ($_POST) {
    $title = $_POST['title'];
    $content = $_POST['content'];
    $time = time();
    $mysqli->query("update `article` set `title`='$title',`content`='$content',where `id`='$id'");
    echo "<script>alert('修改成功');location.href='article.php';</script>";
}
require "templates/edit.html";